package com.wicketFlowTester.framework;

import org.apache.wicket.util.file.File;

public interface FormTesterFacade {

    /**
     * Sets the value of the component.
     * @param formComponentId 
     * @param value
     */
    void setValue(String formComponentId, String value);
    
    /**
     * Sets the value of the component.
     * @param formComponentId 
     * @param value
     */
    void setValue(String checkBoxId, boolean checked);
    
    /**
     * Simulates selecting an option of a <code>FormComponent</code>. 
     * Supported: 
     * <code>RadioGroup</code>, <code>CheckGroup</code>, and <code>AbstractChoice</code> family
     * currently. For a single choice, such as <code>Radio</code> or <code>DropDownList</code>, the selection will toggle each other.
     * @param formComponentId
     * @param index
     */
    void select(String formComponentId, int index);
    
    /**
     * elect multiple options for the <code>FormComponent</code>. The
     * method only support multiple selectable <code>FormComponent</code>s.
     * @param formComponentId
     * @param indexes
     */
    void selectMultiple(String formComponentId, int[] indexes);
    /**
     * Submits the form.
     */
    void submit();
    
    /**
     * Submits the form associated to the button.
     * @param buttonComponentId
     */
    void submit(String buttonComponentId);

    /**
     * Set the file in the form.
     * @param id
     * @param file
     * @param contentType
     */
    void setFile(String formComponentId, File file, String contentType);

}
